Feature/safo6 nrl 721 seed sandbox data#1140
Feature/safo6 nrl 721 seed sandbox data#1140sandyforresternhs wants to merge 30 commits intodevelopfrom
Conversation
|
💥 Something went wrong while deploying the pull request environment. |
|
🚀 PR environment successfully deployed. |
|
🚀 PR environment successfully deployed. |
|
🚀 PR environment successfully deployed. |
|
🚀 PR environment successfully deployed. |
| delete_all_table_items("nonexistent-table") | ||
|
|
||
| mock_exit.assert_called_once_with(1) | ||
| mock_print.assert_called_with("Error: Table 'nonexistent-table' does not exist") |
There was a problem hiding this comment.
oooof - nice! 💪 am liking this mocking of exit and print.... definitely going to borrow that approach 😁
| import boto3 | ||
| from botocore.exceptions import ClientError | ||
|
|
||
| # Needed for when the script is run in Lambda where modules are in scripts subdirectory |
There was a problem hiding this comment.
I think these path/import issues could be fixed by adjusting the lambda runtime environment a little - but not a biggie for now, happy to leave as is and come back to fix later if ever needed. 👍
|
|
||
| locals { | ||
| # take these out once development & testing is complete | ||
| seed_table_names = ["nhsd-nrlf--sandy-dev-pointers-table", "nhsd-nrlf--sandycopy-dev-pointers-table"] |
There was a problem hiding this comment.
probs remove sandycopy from list? or planning to do that after some testing?
There was a problem hiding this comment.
I left those two in for the time being just so that we could see it works with multiple tables, and we can see in the logs they're both getting reseeded. I think the testers will probably want to add and remove tables, but I'm assuming that once we're all happy to merge we can remove the tables listed for dev completely, just leaving the int-sandbox table for test
| description = "Rule to clear and reseed sandbox data" | ||
| # Set this to weekly once development and testing is complete | ||
| # schedule_expression = "cron(0 2 ? * SUN *)" # 2am UTC, every Sunday | ||
| schedule_expression = "cron(0/15 9-17 ? * MON-FRI *)" # Every 15 minutes, 9am-5pm UTC, Monday-Friday |
There was a problem hiding this comment.
worth making this schedule a module var? that way we could have different schedules for dev and test if we want. Not sure if it's worth it though, up to you.
There was a problem hiding this comment.
Great call, yep will do that 👍
| "kms:Decrypt", | ||
| "kms:DescribeKey" | ||
| ] | ||
| Resource = "*" |
There was a problem hiding this comment.
do we have an option to restrict this to a specific key? rather than all keys?
There was a problem hiding this comment.
Good catch, let's do that 👍
| # Only deploys if tables are specified | ||
|
|
||
| locals { | ||
| seed_table_names = ["nhsd-nrlf--int-sandboxcopy-pointers-table"] # Change to int-sandbox-pointers-table when ready |
There was a problem hiding this comment.
change to correct table name before merge (or add the correct one and keep both for now)
There was a problem hiding this comment.
Yep, I was thinking just before merge assuming we're happy for int to get cleared - not sure if we want to give customers the heads up first?
|
|
🚀 PR environment successfully deployed. |



Uh oh!
There was an error while loading. Please reload this page.